<?php
	include_once("../../session_ini.php");
	include_once("../../model/UsuarioService.php");
	
	$service = new UsuarioService();
	$usuario = $service->getUsuario($_SESSION["id_usuario"]);
?>
<script type="text/javascript" src="<?php echo URL_BASE(); ?>/view/js/miCuenta.js"></script>
<div id="popup">
	<h3>Mi cuenta</h3>
	<form action="<?php echo URL_BASE(); ?>/controller/cambiarPassword.php" method="POST" id="cambiarPassword">
		<label><img alt="" src="<?php echo URL_BASE(); ?>/view/images/bullet-historia.png" class="bullet floatLeft" />Contrase&ntilde;a nueva</label>
		<input type="password" name="password" id="password" class="required" minlength="6" />
		<label><img alt="" src="<?php echo URL_BASE(); ?>/view/images/bullet-historia.png" class="bullet floatLeft" />Confirme la nueva contrase&ntilde;a</label>
		<input type="password" name="password2" id="password2" class="required" equalTo="#password" minlength="6" />
		<input type="hidden" name="id_usuario" value="<?php echo $_SESSION["id_usuario"]; ?>" />
		<input type="submit" value="Guardar" class="button" />
	</form>
	<form action="<?php echo URL_BASE(); ?>/controller/miCuenta.php" method="POST" id="actualizarDatos">
		<label><img alt="" src="<?php echo URL_BASE(); ?>/view/images/bullet-historia.png" class="bullet floatLeft" />Email</label>
		<input type="text" name="email" value="<?php echo utf8_encode($usuario->email); ?>" class="required email" />
		<label><img alt="" src="<?php echo URL_BASE(); ?>/view/images/bullet-historia.png" class="bullet floatLeft" />Empresa</label>
		<input type="text" name="empresa" value="<?php echo utf8_encode($usuario->empresa); ?>" />
		<label><img alt="" src="<?php echo URL_BASE(); ?>/view/images/bullet-historia.png" class="bullet floatLeft" />Pa&iacute;s</label>
		<input type="text" name="pais" value="<?php echo utf8_encode($usuario->pais); ?>" />
		<label><img alt="" src="<?php echo URL_BASE(); ?>/view/images/bullet-historia.png" class="bullet floatLeft" />Ciudad</label>
		<input type="text" name="ciudad" value="<?php echo utf8_encode($usuario->ciudad); ?>" />
		<input type="hidden" name="id_usuario" value="<?php echo $_SESSION["id_usuario"]; ?>" />
		<input type="submit" value="Guardar" class="button" />
	</form>
</div>